package lab02.test06;
public class Test06 {
    public static void main(String[] args) {
        System.out.println("测试三角形类:");
        Triangle triangle = new Triangle();
        triangle.setSide1(1);
        triangle.setSide2(3);
        triangle.setSide3(7);

        System.out.println("第一条边:" + triangle.getSide1());
        System.out.println("第二条边:" + triangle.getSide2());
        System.out.println("第三条边:" + triangle.getSide3());

        if(triangle.judgeSide() == true) {                     //判断三角形的三边能不能组成三角形
            System.out.println("此三边可以组成三角形.");
        }
        else {
            System.out.println("此三边不能组成一个三角形，请重新设置三边.");
            triangle.setNewSide1(2.3);
            triangle.setNewSide2(2.1);
            triangle.setNewSide3(3.1);
            System.out.println("新的三边:" + triangle.getNewSide1() + " "+ triangle.getNewSide2() +" " + triangle.getNewSide3());
        }
        System.out.println("三角形的面积:" + triangle.getArea());
        System.out.println("三角形的周长:" + triangle.getPerimeter());

        Ladder ladder = new Ladder();
        ladder.setUpperBottom(3.2);
        ladder.setLowerBottom(5.6);
        ladder.setHigh(3.3);                  //输入梯形的上底，下底，高

        System.out.println("梯形测试:");
        System.out.println("上底:" + ladder.getUpperBottom());
        System.out.println("下底:" + ladder.lowerBottom);
        System.out.println("高:" + ladder.getHigh());
        System.out.println("梯形面积:" + ladder.getArea());

        System.out.println("测试圆类:");
        Circle circle = new Circle();
        circle.setRadius(2.3);           //输入圆的半径
        System.out.println("圆的半径:" + circle.getRadius());
        System.out.println("圆的面积:" + circle.getArea());
        System.out.println("圆的周长:" + circle.getPerimeter());
    }
}
